
<h1><span class="yiyi-st" id="yiyi-12">numpy.fft.irfftn</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.irfftn.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.irfftn.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="function">
<dt id="numpy.fft.irfftn"><span class="yiyi-st" id="yiyi-13"> <code class="descclassname">numpy.fft.</code><code class="descname">irfftn</code><span class="sig-paren">(</span><em>a</em>, <em>s=None</em>, <em>axes=None</em>, <em>norm=None</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/numpy/numpy/blob/v1.11.3/numpy/fft/fftpack.py#L1121-L1211"><span class="viewcode-link">[source]</span></a></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-14">计算实际输入的N维FFT的逆。</span></p>
<p><span class="yiyi-st" id="yiyi-15">该函数通过快速傅立叶变换（FFT）计算用于在M维数组中的任何数量的轴上的实际输入的N维离散傅里叶变换的逆。</span><span class="yiyi-st" id="yiyi-16">换句话说，<code class="docutils literal"><span class="pre">irfftn（rfftn（a），</span> <span class="pre">a.shape）</span> <span class="pre">==</span> <span class="pre">a</span> / t0&gt;在数值精度内。</code></span><span class="yiyi-st" id="yiyi-17">（<code class="docutils literal"><span class="pre">a.shape</span></code>是必需的，例如<code class="docutils literal"><span class="pre">len(a)</span></code>是<a class="reference internal" href="numpy.fft.irfft.html#numpy.fft.irfft" title="numpy.fft.irfft"><code class="xref py py-obj docutils literal"><span class="pre">irfft</span></code></a>，原因同上）。</span></p>
<p><span class="yiyi-st" id="yiyi-18">输入应按照与<a class="reference internal" href="numpy.fft.rfftn.html#numpy.fft.rfftn" title="numpy.fft.rfftn"><code class="xref py py-obj docutils literal"><span class="pre">rfftn</span></code></a>相同的方式排序，即对于最终变换轴，对于<a class="reference internal" href="numpy.fft.irfft.html#numpy.fft.irfft" title="numpy.fft.irfft"><code class="xref py py-obj docutils literal"><span class="pre">irfft</span></code></a>，以及对于<a class="reference internal" href="numpy.fft.ifftn.html#numpy.fft.ifftn" title="numpy.fft.ifftn"><code class="xref py py-obj docutils literal"><span class="pre">ifftn</span></code></a>沿着所有其他轴。</span></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-19">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-20"><strong>a</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-21">输入数组。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-22"><strong>s</strong>：ints序列，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-23">输出（<code class="docutils literal"><span class="pre">s[0]</span></code>指代轴0，<code class="docutils literal"><span class="pre">s[1]</span></code>到轴1等）的形状（每个变换轴的长度）。</span><span class="yiyi-st" id="yiyi-24"><em class="xref py py-obj">s</em>也是沿该轴使用的输入点数，除了最后一个轴，其中使用输入的<code class="docutils literal"><span class="pre">s[-1]//2+1</span></code> 。</span><span class="yiyi-st" id="yiyi-25">沿任何轴，如果<em class="xref py py-obj">s</em>指示的形状小于输入的形状，则输入被裁剪。</span><span class="yiyi-st" id="yiyi-26">如果它较大，输入将用零填充。</span><span class="yiyi-st" id="yiyi-27">如果未给出<em class="xref py py-obj">s</em>，则使用沿<em class="xref py py-obj">轴</em>指定的轴的输入形状。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-28"><strong>axes</strong>：ints序列，可选</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-29">计算逆FFT的轴。</span><span class="yiyi-st" id="yiyi-30">如果未给出，则使用最后的<em class="xref py py-obj">len（s）</em>轴，如果<em class="xref py py-obj">s</em>也未指定，则使用所有轴。</span><span class="yiyi-st" id="yiyi-31"><em class="xref py py-obj">轴</em>中的重复索引表示该轴上的逆变换执行多次。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-32"><strong>norm</strong>：{None，“ortho”}，可选</span></p>
<blockquote>
<div><div class="versionadded">
<p><span class="yiyi-st" id="yiyi-33"><span class="versionmodified">版本1.10.0中的新功能。</span></span></p>
</div>
<p><span class="yiyi-st" id="yiyi-34">规范化模式（参见<a class="reference internal" href="../routines.fft.html#module-numpy.fft" title="numpy.fft"><code class="xref py py-obj docutils literal"><span class="pre">numpy.fft</span></code></a>）。</span><span class="yiyi-st" id="yiyi-35">默认值为None。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-36">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-37"><strong>out</strong>：ndarray</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-38">沿着<em class="xref py py-obj">轴</em>指示的轴变化的截断或零填充输入，或者通过<em class="xref py py-obj">s</em>或<em class="xref py py-obj">a</em>的组合变换，如参数部分。</span><span class="yiyi-st" id="yiyi-39">每个变换轴的长度由<em class="xref py py-obj">s</em>的相应元素给定，或者如果未给出<em class="xref py py-obj">s</em>，则除了最后一个轴之外的每个轴中的输入长度。</span><span class="yiyi-st" id="yiyi-40">在最终变换轴中，当未给出<em class="xref py py-obj">s</em>时的输出长度为<code class="docutils literal"><span class="pre">2*(m-1)</span></code>其中<code class="docutils literal"><span class="pre">m</span></code>最终变换的输入轴。</span><span class="yiyi-st" id="yiyi-41">要在最终轴中获得奇数个输出点，必须指定<em class="xref py py-obj">s</em>。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-42">上升：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-43"><strong>ValueError</strong></span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-44">如果<em class="xref py py-obj">s</em>和<em class="xref py py-obj">轴</em>具有不同的长度。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-45"><strong>IndexError</strong></span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-46">如果<em class="xref py py-obj">axes</em>的元素大于<em class="xref py py-obj">a</em>的轴数。</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title"><span class="yiyi-st" id="yiyi-47">也可以看看</span></p>
<dl class="last docutils">
<dt><span class="yiyi-st" id="yiyi-48"><a class="reference internal" href="numpy.fft.rfftn.html#numpy.fft.rfftn" title="numpy.fft.rfftn"><code class="xref py py-obj docutils literal"><span class="pre">rfftn</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-49">实输入的正向n维FFT，其中<a class="reference internal" href="numpy.fft.ifftn.html#numpy.fft.ifftn" title="numpy.fft.ifftn"><code class="xref py py-obj docutils literal"><span class="pre">ifftn</span></code></a>是反向的。</span></dd>
<dt><span class="yiyi-st" id="yiyi-50"><a class="reference internal" href="numpy.fft.fft.html#numpy.fft.fft" title="numpy.fft.fft"><code class="xref py py-obj docutils literal"><span class="pre">fft</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-51">一维FFT，使用定义和约定。</span></dd>
<dt><span class="yiyi-st" id="yiyi-52"><a class="reference internal" href="numpy.fft.irfft.html#numpy.fft.irfft" title="numpy.fft.irfft"><code class="xref py py-obj docutils literal"><span class="pre">irfft</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-53">实数输入的一维FFT的逆。</span></dd>
<dt><span class="yiyi-st" id="yiyi-54"><a class="reference internal" href="numpy.fft.irfft2.html#numpy.fft.irfft2" title="numpy.fft.irfft2"><code class="xref py py-obj docutils literal"><span class="pre">irfft2</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-55">实数输入的二维FFT的逆。</span></dd>
</dl>
</div>
<p class="rubric"><span class="yiyi-st" id="yiyi-56">笔记</span></p>
<p><span class="yiyi-st" id="yiyi-57">有关所使用的定义和约定，请参见<a class="reference internal" href="numpy.fft.fft.html#numpy.fft.fft" title="numpy.fft.fft"><code class="xref py py-obj docutils literal"><span class="pre">fft</span></code></a>。</span></p>
<p><span class="yiyi-st" id="yiyi-58">有关实际输入的定义和约定，请参见<a class="reference internal" href="numpy.fft.rfft.html#numpy.fft.rfft" title="numpy.fft.rfft"><code class="xref py py-obj docutils literal"><span class="pre">rfft</span></code></a>。</span></p>
<p class="rubric"><span class="yiyi-st" id="yiyi-59">例子</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">((</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mi">3</span> <span class="o">*</span> <span class="mi">2</span> <span class="o">*</span> <span class="mi">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">irfftn</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="go">array([[[ 1.,  1.],</span>
<span class="go">        [ 1.,  1.]],</span>
<span class="go">       [[ 1.,  1.],</span>
<span class="go">        [ 1.,  1.]],</span>
<span class="go">       [[ 1.,  1.],</span>
<span class="go">        [ 1.,  1.]]])</span>
</pre></div>
</div>
</dd></dl>
